import React,{Component} from 'react'

import {
    HashRouter as Router,
    Route,
    Switch
} from 'react-router-dom';

//导入路由组件
import Login from '../pages/login'
import HomePage from '../pages/HomePage'
import DashBoard from '../pages/dashboard/DashBoard'
import Test from '../pages/articles/index'

class Index extends Component{
    render(){
        return (
            <Router>
                <Switch>
                    <Route path='/' exact component={Login} />
                    <Route path='/homepage'>
                        <HomePage>
                            <Route path='/homepage' exact component={()=>'首页'} />
                            <Route path='/homepage/datacount' exact component={DashBoard} />
                        </HomePage>
                    </Route>
                    <Route path='/test' component={Test} />
                </Switch>
            </Router>
        )
    }
}

export default Index